#!/bin/bash
set -e
VER=5.19.17-051917
DATE=202210240939
ARCH=amd64   #注意：如果是arm64或armhf或ppc64el平台，请改这里
URL=https://kernel.ubuntu.com/mainline/v5.19.17/

#1.创建目录，用于存放deb包
mkdir -p ~/kernel-5.19.17 && cd ~/kernel-5.19.17

#2.下载deb包，一共4个
wget ${URL}/${ARCH}/linux-headers-${VER}-generic_${VER}.${DATE}_${ARCH}.deb
wget ${URL}/${ARCH}/linux-headers-${VER}_${VER}.${DATE}_all.deb
wget ${URL}/${ARCH}/linux-image-unsigned-${VER}-generic_${VER}.${DATE}_${ARCH}.deb
wget ${URL}/${ARCH}/linux-modules-${VER}-generic_${VER}.${DATE}_${ARCH}.deb

#3.安装
sudo dpkg -i *.deb
echo "Cleaning files..."
rm -rf kernel-5.19.17
echo "Finish!"
